import axios from 'axios'

let baseURL = ''

const request = axios.create({

    // baseURL,
    timeout: 30 * 1000, // 请求超时 30s
    headers: {
      Accept: '*/*',
      'Content-Type': 'application/json',
      'X-Requested-With': 'XMLHttpRequest'
    },
})

// 前置拦截器（发起请求之前的拦截）
request.interceptors.request.use(
    (config:any) => {
      return config
    },
    (error:any) => {
      return Promise.reject(error)
    }
  )

  request.interceptors.response.use(
    (config:any) => {
      return config
    },
    (error:any) => {
      return Promise.reject(error)
    }
  )

export default request